<template>
	<view class="page-container">
		<view class="tips-info">＊为必填</view>
		<view class="input-contaienr box-container">
			<view class="left-box1">
				<view class="input-tile">头像</view>
				<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="avatar-add">
					<image :src="userInfo.Avatar || '/static/images/my/noAvatar.svg'" class="avatar"></image>
					<image src="/static/images/common/camera.png" class="camear-img"></image>
				</button>
			</view>

			<view class="input-tips">
				<image src="/static/images/my/tips.png"></image>
				<view>建议使用正脸职业照</view>
			</view>
		</view>
		<view class="input-contaienr box-container" @tap="SelectImage('BeijingT')">
			<view class="left-box1">
				<view class="input-tile">背景图</view>
				<view class="avatar-add" style="border-radius: 16rpx">
					<image :src="userInfo.BeijingT" class="bgc-img" mode="aspectFill"></image>
				</view>
			</view>
			<image src="/static/images/my/right.svg" class="down-img"></image>
		</view>

		<view class="input-contaienr">
			<view class="input-box">
				<view class="input-tile">
					姓名
					<span style="color: #e15151">*</span>
				</view>
				<input type="text" style="width: 100%" v-model="userInfo.Name" placeholder="请填写真实姓名" />
			</view>
			<view class="input-box" style="display: block">
				<view style="display: flex; align-items: center; justify-content: space-between; gap: 14rpx">
					<view class="input-tile">
						性别
						<span style="color: #e15151">*</span>
					</view>
					<picker style="width: 100%" :range="sexArray" @change="sexChange">
						<view class="sex-change" :style="{ color: userInfo.SexIndex == 0 ? '#FB353B' : '#FA1B0A' }">
							<view style="color: #000;">{{ sexArray[userInfo.SexIndex] }}</view>
							<image src="/static/images/common/down.svg" class="down-img"></image>
						</view>
					</picker>
				</view>

				<view class="left-box1" style="gap: 32rpx; margin-top: 26rpx">
					<view class="sex-kg">是否公开/隐藏性别标签</view>
					<view class="open-box" @tap="userInfo.ShifouYCXB = !userInfo.ShifouYCXB"
						:style="{ justifyContent: userInfo.ShifouYCXB ? 'flex-end' : 'flex-start' }">
						<view class="open"></view>
					</view>
				</view>
			</view>

			<view class="input-box">
				<view class="input-tile">出生年月</view>
				<picker style="width: 100%" mode="date" @change="changeDate">
					<view class="sex-change" style="color: #000">
						<view>{{ userInfo.ChushengNY || '请选择' }}</view>
						<image src="/static/images/common/down.svg" class="down-img"></image>
					</view>
				</picker>
			</view>
			<view class="input-box">
				<view class="input-tile">地区</view>
				<m-cascader v-model="userInfo.Diqu" :options="AddressDate" :fieldProps="{
						value: 'text',
						label: 'text'
					}" :multiple="false" :save-full-path="true" :disabled="false" placeholder="请选择地点"
					style="width: 100%; font-family: PingFang SC, PingFang SC; font-size: 28rpx; text-align: left; font-style: normal; text-transform: none" />
				<image src="/static/images/common/down.svg" class="down-img"></image>
			</view>
		</view>
		<view class="input-contaienr">
			<view class="input-box" @tap="chooseSchool">
				<view class="input-tile">
					学院学校
					<span style="color: #e15151" v-if="userInfo.sfIndex == 1">*</span>
				</view>
				<view class="input-box" style="padding: 0; border: 0">
					<view class="input-info" :style="{ color: userInfo.BiyeYX ? '#000' : '#999' }">
						{{ userInfo.BiyeYX || '请选择' }}
					</view>
					<image src="/static/images/common/down.svg" class="down-img"></image>
				</view>
			</view>
			<view class="input-box">
				<view class="input-tile">
					最高学历
					<span style="color: #e15151" v-if="userInfo.sfIndex == 1">*</span>
				</view>
				<view class="input-box" style="padding: 0; border: 0">
					<picker mode="selector" style="width: 100%; color: #000" range-key="Value" :range="xueliArray"
						@change="changePicker($event, 'ZuigaoXL', 'xueliArray')">
						<view style="display: flex; align-items: center; justify-content: space-between"
							:style="{ color: userInfo.ZuigaoXL ? '#000' : '#999' }">
							<view>{{ userInfo.ZuigaoXL || '最高学历' }}</view>
							<image src="/static/images/common/down.svg" class="down-img"></image>
						</view>
					</picker>
					<!-- <image src="/static/images/common/down.svg" class="down-img"></image> -->
					<!-- <uni-data-select style="width: 100%" v-model="userInfo.Gongsi" :localdata="Array.companyArray" placeholder="公司/单位名称"></uni-data-select> -->
				</view>
			</view>
			<view class="input-box" @tap="chooseZhuanye">
				<view class="input-tile">专业</view>
				<view class="input-box" style="padding: 0; border: 0">
					<view class="input-info" :style="{ color: userInfo.Zhuanye ? '#000' : '#999' }">
						{{ userInfo.Zhuanye || '请选择' }}
					</view>
					<image src="/static/images/common/down.svg" class="down-img"></image>
				</view>
			</view>
			<view class="input-box">
				<view class="input-tile">入学时间</view>
				<view class="input-box" style="border: 0; padding: 0">
					<!-- <view @tap="Ruxuevisible = true">{{ userInfo.RuxueStart || '请选择' }}-{{ userInfo.RuxueEnd || '请选择' }}</view> -->
					<picker @change="bindPickerChange($event, 'RuxuestartIndex')" :value="userInfo.RuxuestartIndex"
						:range="startYearArray">
						<view class="uni-input">{{ startYearArray[userInfo.RuxuestartIndex] }}</view>
					</picker>
					<tui-icon name="reduce" color="#000" bold="true" size="20"></tui-icon>
					<picker @change="bindPickerChange($event, 'RUxueendIndex')" :value="userInfo.RUxueendIndex"
						:range="endYearArray">
						<view class="uni-input">{{ endYearArray[userInfo.RUxueendIndex] }}</view>
					</picker>
					<image src="/static/images/common/down.svg" class="down-img"></image>
					<!-- <uni-data-select style="width: 100%" v-model="userInfo.Gongsi" :localdata="Array.companyArray" placeholder="公司/单位名称"></uni-data-select> -->
				</view>
			</view>
		</view>
		<view class="input-contaienr">
			<view class="input-box" style="border: 0">
				<view class="input-tile">我的介绍</view>
			</view>
			<view class="" style="margin:0 20rpx 20rpx;">
				<textarea @blur="bindTextAreaBlur" auto-height name="" placeholder="请你写我的介绍"></textarea>
			</view>
		</view>
		<view class="input-contaienr" @tap="biaoq = true">
			<view class="input-box" style="border: 0">
				<view class="input-tile">我的技能</view>
				<image src="/static/images/common/down.svg" class="down-img"></image>
			</view>
			<view v-if="userInfo.Jineng && userInfo.Jineng.length" class="input-box">
				<view class="BQ-box">
					<view class="add-BQ" style="margin: 0; padding: 0 12rpx" v-for="item in userInfo.Jineng">
						{{ item }}
					</view>
				</view>
			</view>
			<view v-else class="add-bq-box">
				<view class="left-box">
					<image src="/static/images/my/addBQ.png" mode="widthFix" style="width: 34rpx"></image>
					<view>暂无添加的标签（0/8）</view>
				</view>
				<view class="right-btn">
					<view class="">补充</view>
					<tui-icon name="arrowright" color="#fff" size="20"></tui-icon>
				</view>
			</view>
		</view>
		<view class="save-btn"
			:style="{ marginBottom: winInfo && winInfo.safeAreaInsets && winInfo.safeAreaInsets.bottom + 'px' }"
			@tap="submit">保存</view>

		<!-- 新增标签 -->
		<tui-bottom-popup :zIndex="1002" backgroundColor="#F4F5F6" :maskZIndex="1001" :show="biaoq"
			@close="biaoq = false">
			<view class="Biaoq-popup">
				<tui-icon name="shut" color="#8E8E93" size="20" @tap="biaoq = false" class="shut-info"></tui-icon>
				<view class="top-image">
					<view class="bq-title">
						<view>选择个性标签</view>
						<view>丰富有趣的你～</view>
					</view>
					<image src="https://minio.nbweixin.cn/public/baiying/img/20250514/BQbgc.png" mode="widthFix">
					</image>
				</view>
				<!-- 我的标签 -->
				<view class="BQ-container">
					<view class="BQ-title1">我的标签</view>
					<view class="BQ-box">
						<view class="add-BQ" @tap="showAddbq">
							<tui-icon name="plus" color="#FB353B" bold="true" size="20"></tui-icon>
							<view>新增标签</view>
						</view>

						<view v-for="(item, index) in jinengArray" @tap="selectBQ(index)">
							<view class="add-BQ" v-if="!item.selected"
								style="background-color: #fb353b; color: #fff; border: 0">
								<view>{{ item.Value }}</view>
								<tui-icon name="shut" color="#fff" size="20" bold="true"></tui-icon>
							</view>
						</view>
					</view>
				</view>
				<!-- 全部标签 -->
				<view class="BQ-container">
					<view class="BQ-title1">全部标签</view>
					<scroll-view scroll-y="true">
						<view class="BQ-box">
							<view v-for="(item, index) in jinengArray" @tap="selectBQ(index)">
								<view class="add-BQ" style="border: calc(1rpx * 1.9) solid #000; color: #000"
									v-if="item.selected">
									<view>{{ item.Value }}</view>
									<tui-icon name="plus" color="#000" size="20" bold="true"></tui-icon>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<view class="BQ-save"
					:style="{ bottom: winInfo && winInfo.safeAreaInsets && winInfo.safeAreaInsets.bottom + 'px' }"
					@tap="saveBQ">保存</view>
			</view>
		</tui-bottom-popup>
		<tui-modal :show="addBQmodel" padding="0" custom>
			<view class="qianming-popup">
				<view class="qianming-header">
					<view @tap="addBQmodel = false" style="color: #8d8d8e">取消</view>
					<view class="qianming-title">添加个性标签</view>
					<view @tap="saveAddBQ" style="color: #5e59e8">保存</view>
				</view>
				<input type="text" :adjust-position="false" :focus="Qmfocus" v-model="addBQ" maxlength="6"
					placeholder="请输入内容" />
			</view>
		</tui-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				startTime: '',
				Islogin: this.Microi.IsLogin(),
				CurrentUser: this.Microi.GetCurrentUser(),
				IsDisabled: false,
				winInfo: {},
				userInfo: {
					Avatar: '',
					BeijingT: '',
					Name: '',
					Sex: '',
					SexIndex: 0,
					ShifouYCXB: 0,
					ChushengNY: '',
					ZuigaoXL: '',
					sfIndex: 0,
					Xinzi: '',
					RuxuestartIndex: 0,
					RUxueendIndex: 0,
					Gangwei: '',
					Gongsi: '',
					Zhiwei: '',
					Jineng: [],
					BiyeYX: '',
					Zhuanye: '',
					Diqu: [],
					GongsiID: '',
					XuexiaoID: '',
					ZhuanyeID: ''
				},
				AddressDate: [],
				startYearArray: [],
				endYearArray: [],
				xueliArray: [],
				XinziArray: [],
				schoolArray: [],
				companyArray: [],
				GangweiArray: [],
				hangyeArray: [],
				zhiweiArray: [],
				MajorArray: [],
				jinengArray: [],
				sexArray: ['男', '女'],
				sfArray: ['在职', '学生', '自由职业'],
				biaoq: false,
				addBQmodel: false,
				Qmfocus: false,
				addBQ: '',
			};
		},
		mounted() {
			let obj = {};
			// #ifdef MP-WEIXIN
			obj = wx.getMenuButtonBoundingClientRect();
			// #endif
			// #ifdef MP-BAIDU
			obj = swan.getMenuButtonBoundingClientRect();
			// #endif
			// #ifdef MP-ALIPAY
			my.hideAddToDesktopMenu();
			// #endif

			setTimeout(() => {
				uni.getSystemInfo({
					success: (res) => {
						res.width = obj.left || res.windowWidth;
						res.tabwidth = this.width * 0.45;
						res.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44;

						res.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6;
						res.scrollH = res.windowWidth;
						this.winInfo = res;
						// if (res.hostName == 'WeChat') {
						// 	this.top = this.top + 30;
						// }
					}
				});
			}, 0);
		},
		onLoad() {
			var self = this;
			self.getCityData();
			self.userInfo = self.CurrentUser;
			this.getFabuInfo();
			setTimeout(function() {
				self.getUserInfo();
			}, 500);
		},
		onShow() {
			if (uni.getStorageSync('schoolInfo')) {
				this.userInfo.BiyeYX = uni.getStorageSync('schoolInfo').name;
				this.userInfo.XuexiaoID = uni.getStorageSync('schoolInfo').Id;
				uni.removeStorageSync('schoolInfo');
			}
			if (uni.getStorageSync('companyInfo')) {
				this.userInfo.Gongsi = uni.getStorageSync('companyInfo').name;
				this.userInfo.GongsiID = uni.getStorageSync('companyInfo').Id;
				uni.removeStorageSync('companyInfo');
			}
			if (uni.getStorageSync('Zhiwei')) {
				this.userInfo.Zhiwei = uni.getStorageSync('Zhiwei').name;
				// this.userInfo.GongsiID = uni.getStorageSync('companyInfo').Id;
				uni.removeStorageSync('Zhiwei');
			}
			if (uni.getStorageSync('GangweiM')) {
				this.userInfo.Gangwei = uni.getStorageSync('GangweiM').Id;
				// this.userInfo.GongsiID = uni.getStorageSync('companyInfo').Id;
				uni.removeStorageSync('GangweiM');
			}
			if (uni.getStorageSync('Zhuanye')) {
				this.userInfo.Zhuanye = uni.getStorageSync('Zhuanye').name;
				this.userInfo.ZhuanyeID = uni.getStorageSync('Zhuanye').Id;
				uni.removeStorageSync('Zhuanye');
			}
			this.startTime = new Date();
		},
		onHide() {
			if (this.Islogin) {
				// 获取当前页面栈
				const pages = getCurrentPages();
				// 获取当前页面的对象
				const currentPage = pages[pages.length - 1];
				// 获取当前页面的路径
				const route = currentPage.route;
				// 获取当前页面的参数
				const options = currentPage.options;
				this.Microi.ApiEngine.Run('Add_liulanLog', {
					YemianCS: options,
					YemianDZ: route,
					LiulanSJC: new Date().getTime() - this.startTime.getTime()
				});
			}
		},
		onUnload() {
			if (this.Islogin) {
				// 获取当前页面栈
				const pages = getCurrentPages();
				// 获取当前页面的对象
				const currentPage = pages[pages.length - 1];
				// 获取当前页面的路径
				const route = currentPage.route;
				// 获取当前页面的参数
				const options = currentPage.options;
				this.Microi.ApiEngine.Run('Add_liulanLog', {
					YemianCS: options,
					YemianDZ: route,
					LiulanSJC: new Date().getTime() - this.startTime.getTime()
				});
			}
		},
		methods: {
			async getCityData() {
				var res = await this.Microi.ApiEngine.Run('get_cityData');
				this.AddressDate = res.Data;
			},
			async getUserInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_UserInfo', {
					YonghuID: self.CurrentUser?.Id,
					Type: 1
				});
				self.userInfo = res.Data;
				if (self.userInfo.Jineng) {
					self.userInfo.Jineng = JSON.parse(self.userInfo.Jineng);
					self.jinengArray.forEach((item) => {
						var index = self.userInfo.Jineng.findIndex((val) => {
							return val == item.Value; // 添加return语句
						});
						if (index != -1) {
							item.selected = false; // 修改数组中对象的属性
						} else {
							item.selected = true;
						}
					});
					self.userInfo.Jineng.forEach((item) => {
						var index = self.jinengArray.findIndex((val) => {
							return val.Value == item; // 添加return语句
						});
						if (index == -1) {
							self.jinengArray.unshift({
								Value: item,
								selected: false
							});
						}
					});
				}
				if (self.userInfo.Diqu) self.userInfo.Diqu = self.userInfo.Diqu.split(' ');
				// if (self.userInfo.Zhuanye) self.userInfo.Zhuanye = JSON.parse(self.userInfo.Zhuanye);

				self.userInfo.sfIndex = res.Data.sfIndex || 0;
				self.userInfo.SexIndex = self.sexArray.findIndex((item) => item == self.userInfo.Sex);
				self.userInfo.RuxuestartIndex = 0;
				self.userInfo.RUxueendIndex = 0;
				if (!this.userInfo.BeijingT) {
					this.get_morenBGC();
				}
			},
			hangyeChoose() {
				uni.navigateTo({
					url: '/pages/my/companyChoose/zhiweiChoose'
				});
			},
			chooseZhiwei() {
				uni.navigateTo({
					url: '/pages/my/companyChoose/commonChoose?Type=5&headerTitle=职位选择&InfoName=Zhiwei&ParentKey=zhiwei'
				});
			},
			// 专业选择
			chooseZhuanye() {
				uni.navigateTo({
					url: '/pages/my/companyChoose/commonChoose?Type=10&headerTitle=专业&InfoName=Zhuanye&ParentKey=schoolMajor'
				});
			},
			chooseSchool() {
				uni.navigateTo({
					url: '/pages/my/schoolChoose/schoolChoose'
				});
			},
			chooseGongsi() {
				uni.navigateTo({
					url: '/pages/my/companyChoose/companyChoose'
				});
			},
			async saveBQ() {
				var self = this;
				var BQ = [];
				self.jinengArray.forEach((item) => {
					if (!item.selected) BQ.push(item.Value);
				});
				if (BQ.length > 8) {
					this.Microi.Tips('最多选择8个标签', false);
					return;
				}
				self.userInfo.Jineng = BQ;
				self.biaoq = false;
			},
			changePicker(e, name1, name2, value = 'Value') {
				this.userInfo[name1] = this[name2][e.detail.value][value];
			},
			saveAddBQ() {
				if (!this.addBQ) {
					this.Microi.Tips('标签不得为空', false);
					return;
				}
				this.jinengArray.unshift({
					Value: this.addBQ,
					selected: false
				});
				this.addBQ = '';
				// this.$refs.addBQmodel.close();
				this.addBQmodel = false;
			},
			showAddbq() {
				this.Qmfocus = true;
				this.addBQmodel = true;
			},
			selectBQ(index) {
				this.jinengArray[index].selected = !this.jinengArray[index].selected;
			},
			async get_morenBGC() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('customize_crud', {
					EngineKey: 'KEY000007'
				});
				this.userInfo.BeijingT = this.Microi.FileServer + res.Data;
			},
			sexChange(e) {
				this.userInfo.SexIndex = e.detail.value;
				this.userInfo.Sex = this.sexArray[e.detail.value];
			},
			ShenfenChange(e) {
				this.userInfo.sfIndex = e.detail.value;
			},
			changeDate(e) {
				this.userInfo.ChushengNY = e.detail.value;
			},
			async getFabuInfo() {
				var self = this;
				var yearInfo = [];
				var yearNow = parseInt(new Date().getFullYear());
				this.endYearArray = ['至今'];
				for (var year = yearNow; year >= 1990; year--) {
					this.endYearArray.push(year);
					this.startYearArray.push(year);
				}
				this.userInfo.RuxuestartIndex = 2;
				this.getCompanyInfo();
				this.getGangweiInfo();
				this.getZhiweiInfo();
				this.getXinziInfo();
				this.getSchoolInfo();
				this.getMajorInfo();
				this.getxueliInfo();
				var jineng = await self.Microi.ApiEngine.Run('customize_crud', {
					EngineKey: 'KEY000003'
				});
				this.jinengArray = jineng.Data;
				console.log(this.jinengArray, 'jineng');
			},
			//  公司列表
			async getCompanyInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 0
				});
				this.companyArray = res.Data;
			},

			// 岗位列表
			async getGangweiInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 2
				});
				self.GangweiArray = res.Data;
				// self.userInfo.Gangwei = res.Data[0].GangweiM;
				// var Gangwei = [];
				// self.userInfo.Gangwei.forEach((item) => {
				// 	Gangwei.push(item);
				// });
				// if (!Gangwei || !Gangwei.length) Gangwei = [res.Data[0].Id];
				// self.userInfo.Gangwei = Gangwei;
			},
			// 职位
			async getZhiweiInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 5
				});
				self.zhiweiArray = res.Data;
			},
			// 薪资
			async getXinziInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 6
				});
				self.XinziArray = res.Data;
			},
			// 学校
			async getSchoolInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 7
				});
				self.schoolArray = res.Data;
			},
			// 学历
			async getxueliInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 8
				});
				self.xueliArray = res.Data;
			},
			// 专业列表
			async getMajorInfo() {
				var self = this;
				var res = await self.Microi.ApiEngine.Run('get_HDfb_info', {
					Type: 9
				});
				self.MajorArray = res.Data;
				// self.userInfo.Zhuanye = res.Data[0].GangweiM;
			},
			async onChooseAvatar(e) {
				uni.showLoading({
					title: '上传中...'
				});
				var self = this;
				const {
					avatarUrl
				} = e.detail;
				console.log(e.detail);
				var avatar = await self.uploadImage(e.detail.avatarUrl);
				console.log(avatar, 'avatar');
				self.userInfo.Avatar = avatar.url;

				uni.hideLoading();
			},
			// 照片上传
			async SelectImage(name) {
				var self = this;
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: async function(res) {
						console.log(JSON.stringify(res.tempFilePaths));
						uni.showLoading({
							title: '上传照片中',
							mask: true
						});

						var array = res.tempFilePaths[0];
						var res = await self.uploadImage(array);
						self.userInfo[name] = res.url;
						console.log(self.userInfo);
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
					}
				});
			},
			bindTextAreaBlur: function(e) {
				var self = this;
				this.userInfo.Jianjie=e.detail.value
				console.log(e.detail.value)
			},
			async submit() {
				var self = this;
				if (self.IsDisabled) {
					self.Microi.Tips('请勿重复点击', false);
					return;
				}
				self.IsDisabled = true;
				var UserInfo = self.userInfo;
				if (!UserInfo.Name) {
					self.Microi.Tips('请填写姓名', false);
					self.IsDisabled = false;
					return;
				}
				if (!UserInfo.Sex) {
					self.Microi.Tips('请选择性别', false);
					self.IsDisabled = false;
					return;
				}
				if (!UserInfo.BiyeYX) {
					self.Microi.Tips('请选择院校', false);
					self.IsDisabled = false;
					return;
				}
				if (!UserInfo.ZuigaoXL) {
					self.Microi.Tips('请选择学历', false);
					self.IsDisabled = false;
					return;
				}
				if (UserInfo.Jineng && UserInfo.Jineng.length > 10) {
					self.Microi.Tips('最多选择10个技能标签', false);
					self.IsDisabled = false;
					return;
				}

				var res = await self.Microi.ApiEngine.Run('upt_userInfo', {
					UserInfo: UserInfo,
					Id: self.CurrentUser.Id
				});
				// var res = await self.Microi.FormEngine.UptFormData({
				// 	FormEngineKey: 'sys_user',
				// 	Id: self.CurrentUser.Id,
				// 	_RowModel: UserInfo
				// });
				self.Microi.SetCurrentUser(self.userInfo);
				if (res.Code == 1) {
					this.Microi.Tips('修改成功', true);
					setTimeout(function() {
						// uni.navigateBack({
						// 	delta: 1
						// });
					}, 1000);
				}
			},
			companyChange(e) {
				console.log(e);
				this.userInfo.GongsiID = e.Id;
			},
			deleteImage(e, name) {
				const index = this.userInfo[name].findIndex((item) => item.Url == e.url);
				if (index > -1) {
					this.userInfo[name].splice(index, 1);
				}
			},
			async uploadImage(Path) {
				if (Path.indexOf('https://minio.nbweixin.cn/public') == -1) {
					var res = await this.Microi.Upload({
						Path: '/img', // 文件路径前缀
						Limit: false, // 是否上传到私有存储桶
						Preview: true, // 是否压缩图片
						_FilePath: Path
					});
					if (res.Code == 1) {
						var obj = {
							Path: res.Data.Path,
							Name: res.Data.Name,
							Size: res.Data.Size,
							CreateTime: res.Data.CreateTime,
							Id: res.Data.Id,
							url: this.GetServerPath(res.Data.Path),
							name: res.Data.Name,
							extname: res.Data.Path.split('.')[1]
						};
						return obj;
					}
				} else {
					let endIndex = Path.indexOf('https://minio.nbweixin.cn/public');
					// code = url.substring(0,endIndex)
					var Path1 = Path.substring(0, endIndex);
					console.log(Path, 'Path');
					return Path1;
				}
			},
			GetServerPath(Path) {
				if (!Path) {
					return '';
				}
				return this.Microi.FileServer + Path;
			}
		}
	};
</script>

<style>
	.page-container {
		padding: 20rpx;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #f4f5f6;
	}

	page {
		background-color: #f4f5f6;
	}

	.tips-info {
		background: rgba(217, 217, 217, 0);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		font-family: Inter, Inter;
		font-size: 20rpx;
		color: #8e8e8e;
		line-height: 23rpx;
		text-align: center;
		font-style: normal;
		text-transform: none;
		margin-bottom: 24rpx;
	}

	.input-box-header {
		width: 100%;
		height: 154rpx;
		background: #ffffff;
		border-radius: 16rpx;
		border: 1rpx solid #f4f5f6;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 24rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
	}

	.input-tile {
		min-width: 140rpx;
		height: 40rpx;
		font-family: PingFang SC;
		font-size: 26rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
		white-space: nowrap;
	}

	.input-info {
		flex: 1;
		height: 40rpx;
		font-family: PingFang SC;
		font-size: 28rpx;
		color: #333;
		text-align: left;
		font-style: normal;
		text-transform: none;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.bgc-img {
		width: 96rpx;
		height: 96rpx;
		/* background: linear-gradient(315deg, #8a96ab 0%, #686f7d 100%); */
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.avatar-add {
		padding: 0;
		margin: 0;
		background: none;
		width: 100rpx;
		height: 100rpx;
		position: relative;
		margin: 0;
	}

	.camear-img {
		position: absolute;
		bottom: 0;
		right: 0rpx;
		width: 40rpx;
		height: 40rpx;
	}

	.avatar {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}

	.input-tips {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 12rpx;

		font-family: Inter, Inter;
		font-weight: 400;
		font-size: 20rpx;
		color: #e15151;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}

	.input-tips image {
		width: 24rpx;
		height: 24rpx;
	}

	.right-img {
		width: 28rpx;
		height: 28rpx;
	}

	.input-contaienr {
		width: 100%;
		background: #ffffff;
		border-radius: 20rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
		overflow: hidden;
	}

	.box-container {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 28rpx 26rpx;
		box-sizing: border-box;
	}

	.left-box1 {
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	.input-box {
		width: 100%;
		background: #ffffff;
		border-bottom: 1rpx solid #f4f5f6;
		padding: 24rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		gap: 20rpx;
	}

	.sex-change {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-family: PingFang SC;
		font-size: 28rpx;
		color: #fb353b;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.sex-kg {
		height: 40rpx;
		font-family: PingFang SC;

		font-size: 28rpx;
		color: #999999;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.open-box {
		width: 44rpx;
		height: 24rpx;
		background: #fb353b;
		border-radius: 56rpx 56rpx 56rpx 56rpx;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		padding: 2rpx;
		margin: auto 0;
		transform: translate(3s);
	}

	.open-box .open {
		width: 20rpx;
		height: 20rpx;
		background: #ffffff;
		border-radius: 56rpx 56rpx 56rpx 56rpx;
	}

	picker {
		font-family: PingFang SC;

		font-size: 28rpx;
		color: #666;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.sf-box {
		width: 188rpx;
		height: 106rpx;
	}

	.down-img {
		width: 24rpx !important;
		height: 36rpx !important;
		margin: auto 0;
		flex-shrink: 0;
	}

	zxz-uni-data-select input picker m-cascader {
		font-family: PingFang SC;

		font-size: 32rpx;
		color: #999999;
		line-height: 38rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.save-btn {
		width: 496rpx;
		height: 68rpx;
		background: #fb353b;
		border-radius: 80rpx 80rpx 80rpx 80rpx;
		margin: auto;
		margin-top: 100rpx;

		font-family: PingFang SC;

		font-size: 32rpx;
		color: #ffffff;
		line-height: 68rpx;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}

	.uni-input {
		font-family: PingFang SC;
		font-weight: normal;
		/* font-size: 32rpx; */
		color: #000;
		line-height: 38rpx;
		font-style: normal;
		text-transform: none;
		white-space: nowrap;
	}

	/* 标签 */
	.Biaoq-popup {
		width: 100vw;
		height: 85vh;
		border-radius: 20rpx 20rpx 0 0;
		padding: 20rpx calc(16rpx * 1.9);
		box-sizing: border-box;
		position: relative;
	}

	.shut-info {
		position: absolute;
		top: 2%;
		right: 2%;
	}

	.BQ-bgc1 {
		position: absolute;
		left: 0;
		z-index: -1;
	}

	.BQ-bgc2 {
		position: absolute;
		right: 0;
		filter: blur(47px);
		z-index: -1;
	}

	.top-image {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		padding-top: calc(21rpx * 1.9);
		padding-bottom: calc(20rpx * 1.9);
	}

	.top-image image {
		width: 350rpx;
	}

	.bq-title {
		color: #fb353b;
		font-family: 'AlibabaPuHuiTi';
		font-size: calc(24rpx * 1.9);
		font-style: normal;
		font-weight: 900;
		line-height: calc(40rpx * 1.9);
		width: calc(200rpx * 1.9);
	}

	.BQ-container {
		z-index: 999;
	}

	.BQ-title1 {
		color: #000;
		font-size: calc(16rpx * 1.9);
		font-style: normal;
		line-height: calc(24rpx * 1.9);
		margin-bottom: calc(16rpx * 1.9);
	}

	.BQ-box {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		flex-wrap: wrap;
		gap: 16rpx;
		max-height: 500rpx;
		padding: 0 10rpx;
	}

	.add-BQ {
		display: flex;
		box-sizing: border-box;
		font-size: 28rpx;
		justify-content: center;
		align-items: center;
		border-radius: 36rpx;
		border: 2rpx solid #fb353b;
		color: #fb353b;
		gap: 8rpx;
		height: 56rpx;
		padding: 0 40rpx;
		white-space: nowrap;
	}

	.add-bq-box {
		margin: auto;
		margin-bottom: 38rpx;
		width: 636rpx;
		height: 102rpx;
		background: #f5f5f5;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 36rpx 34rpx;
		box-sizing: border-box;

		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.add-bq-box .left-box {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 12rpx;

		font-family: PingFang SC, PingFang SC;
		font-size: 28rpx;
		color: #666666;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.add-bq-box .right-btn {
		width: 144rpx;
		height: 60rpx;
		background: #fb353b;
		border-radius: 80rpx 80rpx 80rpx 80rpx;

		display: flex;
		align-items: center;
		justify-content: center;

		font-family: PingFang SC, PingFang SC;
		font-size: 32rpx;
		color: #ffffff;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}

	.BQ-save {
		position: absolute;

		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background-color: #fb353b;
		font-size: calc(16rpx * 1.9);
		border-radius: 60rpx;
		width: calc(361rpx * 1.9);
		color: #fff;
	}

	.qianming-popup {
		border-radius: calc(12rpx * 1.9) calc(12rpx * 1.9) 0px 0px;
		padding: 20rpx;
	}

	.qianming-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: calc(14rpx * 1.9);
		margin: calc(16rpx * 1.9);
		box-sizing: border-box;
	}

	.qianming-popup input {
		width: 80%;
		padding: calc(9rpx * 1.9) calc(12rpx * 1.9);
		background-color: #f4f5f6;
		margin: auto;
		border-radius: 30rpx;
	}

	.qianming-title {
		font-size: calc(16rpx * 1.9);
	}
</style>